package com.qf.shop.service.impl;

import com.qf.shop.dao.Impl.TypeDaoImpl;
import com.qf.shop.dao.TypeDao;
import com.qf.shop.entity.Type;
import com.qf.shop.service.TypeService;
import com.qf.shop.utils.DruidUtils;

import java.util.List;

public class TypeServiceImpl implements TypeService {
    @Override
    public List<Type> getAllTypes() {
        TypeDao typeDao =new TypeDaoImpl();
        List<Type> types = null;
        try {
            DruidUtils.begin();
            types=typeDao.selectAll();
            DruidUtils.commit();
        } catch (Exception e) {
            DruidUtils.rollback();
            e.printStackTrace();
        }
        return types;
    }
}
